(function (paw, _super, utils, DOMPurify) {

    /**
     *  settings {
          blob: Blob,
          url: string,
          controls: boolean,
          downloadUrl: string,
          scaling: boolean,
          previewNotAvailableLabel: string
        }
     * 
     * @param {any} $container
     * @param {any} settings
    */
    paw.lang.extend(AudioFileComponent, _super);
    function AudioFileComponent($container, settings) {
        _super.call(this, $container, settings, 'fa fa fa-file-audio fa-4x');
        this.result = null;
    }

    AudioFileComponent.prototype.compilePreview = function () {
        var markup = [
            '<div class="paw-preview-not-available">',
            '   <div class="paw-preview-not-available-label">',
            '      <div><span class="fa fa fa-file-audio fa-2x"></span></div>',
            '      <div><span>' + this.settings.extension + '</span></div>',
            '   </div>',
            '   <div class="paw-preview-download"><a href="' + (this.settings.downloadUrl || this.settings.url) + '" onclick="event.stopPropagation();" target="_blank" class="paw-preview-link"><button type="button"><i class="fa fa-download"></i></button></a></div>',
            '</div>'
        ];
        var $msg = $(markup.join('\n'));
        this.$container.html($msg);
        return utils.async.promise();
    };
    

    paw.com.AudioFileComponent = AudioFileComponent;
})(paw, paw.com.DocumentViewerComponent, paw.utils, DOMPurify);