Get the Best IPTV Service
define("discourse/plugins/discourse-data-explorer/admin/adapters/query",["exports","admin/adapters/build-plugin"],function(e,t){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 e.default=(0,t.default)("explorer").extend({})}),define("discourse/plugins/discourse-data-explorer/discourse/components/code-view",["exports","@ember/component","@ember/template-factory","@ember/component/template-only"],function(e,t,r,s){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 const o=(0,t.setComponentTemplate)((0,r.createTemplateFactory)({id:"Y/NEd3wQ",block:'[[[1,"\\n "],[10,"pre"],[12],[10,"code"],[15,0,[30,1]],[12],[1,[30,2]],[13],[13],[1,"\\n"]],["@codeClass","@value"],false,[]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/code-view.js",isStrictMode:!0}),(0,s.default)(void 0,"code-view:CodeView")) e.default=o}),define("discourse/plugins/discourse-data-explorer/discourse/components/data-explorer-bar-chart",["exports","@glimmer/component","@ember/modifier","@ember/object","@ember/render-modifiers/modifiers/did-insert","discourse/lib/decorators","discourse/lib/load-script","discourse/plugins/discourse-data-explorer/discourse/lib/themeColor","@ember/component","@ember/template-factory"],function(e,t,r,s,o,i,n,a,l,u){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 class d extends t.default{chart barsColor=(()=>(0,a.default)("--tertiary"))() barsHoverColor=(()=>(0,a.default)("--tertiary-high"))() gridColor=(()=>(0,a.default)("--primary-low"))() labelsColor=(()=>(0,a.default)("--primary-medium"))() willDestroy(){super.willDestroy(...arguments),this.chart.destroy()}get config(){return{type:"bar",data:this.data,options:this.options}}get data(){return{labels:this.args.labels,datasets:[{label:this.args.datasetName,data:this.args.values,backgroundColor:this.barsColor,hoverBackgroundColor:this.barsHoverColor}]}}get options(){return{scales:{legend:{labels:{fontColor:this.labelsColor}},xAxes:[{gridLines:{color:this.gridColor,zeroLineColor:this.gridColor},ticks:{fontColor:this.labelsColor}}],yAxes:[{gridLines:{color:this.gridColor,zeroLineColor:this.gridColor},ticks:{beginAtZero:!0,fontColor:this.labelsColor}}]}}}async initChart(e){await(0,n.default)("/javascripts/Chart.min.js") const t=e.getContext("2d") this.chart=new Chart(t,this.config)}static#e=(()=>dt7948.n(this.prototype,"initChart",[i.bind]))() updateChartData(){this.chart.data=this.data,this.chart.update()}static#t=(()=>dt7948.n(this.prototype,"updateChartData",[s.action]))() static#r=(()=>(0,l.setComponentTemplate)((0,u.createTemplateFactory)({id:"wYJzNUVF",block:'[[[1,"\\n "],[11,"canvas"],[4,[32,0],[[30,0,["initChart"]]],null],[4,[32,1],["change",[30,0,["updateChartData"]]],null],[12],[13],[1,"\\n "]],[],false,[]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/data-explorer-bar-chart.js",scope:()=>[o.default,r.on],isStrictMode:!0}),this))()}e.default=d}),define("discourse/plugins/discourse-data-explorer/discourse/components/explorer-schema",["exports","@glimmer/component","@glimmer/tracking","@ember/modifier","@ember/object","@ember/utils","discourse/components/conditional-loading-spinner","discourse/components/d-button","discourse/helpers/with-event-value","discourse/lib/decorators","discourse/plugins/discourse-data-explorer/discourse/components/explorer-schema/one-table","@ember/component","@ember/template-factory"],function(e,t,r,s,o,i,n,a,l,u,d,c,p){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 class m extends t.default{static#e=(()=>dt7948.g(this.prototype,"filter",[r.tracked]))() #s=(()=>{dt7948.i(this,"filter")})() static#t=(()=>dt7948.g(this.prototype,"loading",[r.tracked]))() #o=(()=>{dt7948.i(this,"loading")})() static#r=(()=>dt7948.g(this.prototype,"hideSchema",[r.tracked],function(){return this.args.hideSchema}))() #i=(()=>{dt7948.i(this,"hideSchema")})() get transformedSchema(){const e=this.args.schema for(const t in e)e.hasOwnProperty(t)&&e[t].forEach(e=>{const t=[] e.primary&&t.push("primary key"),e.is_nullable&&t.push("null"),e.column_default&&t.push("default "+e.column_default),e.fkey_info&&t.push("fkey "+e.fkey_info),e.denormal&&t.push("denormal "+e.denormal) const r=t.join(", ") r&&(e.notes=r),(e.enum||e.column_desc)&&(e.havepopup=!0),e.havetypeinfo=!!(e.notes||e.enum||e.column_desc)}) return e}get filteredTables(){let e=[],t=this.filter try{(0,i.isBlank)(this.filter)||(t=new RegExp(this.filter))}catch{t=null}const r=!!t for(const s in this.transformedSchema)if(this.transformedSchema.hasOwnProperty(s))if(r)if(t.source===s||t.source+"s"===s)e.unshift({name:s,columns:this.transformedSchema[s],open:r}) else if(t.test(s))e.push({name:s,columns:this.transformedSchema[s],open:r}) else{let o=[] this.transformedSchema[s].forEach(e=>{t.source===e.column_name?o.unshift(e):t.test(e.column_name)&&o.push(e)}),(0,i.isEmpty)(o)||e.push({name:s,columns:o,open:r})}else e.push({name:s,columns:this.transformedSchema[s],open:!1}) return e}updateFilter(e){this.filter=e.toLowerCase(),this.loading=!1}static#n=(()=>dt7948.n(this.prototype,"updateFilter",[(0,u.debounce)(500)]))() filterChanged(e){this.loading=!0,this.updateFilter(e)}static#a=(()=>dt7948.n(this.prototype,"filterChanged",[o.action]))() collapseSchema(){this.hideSchema=!0,this.args.updateHideSchema(!0)}static#l=(()=>dt7948.n(this.prototype,"collapseSchema",[o.action]))() expandSchema(){this.hideSchema=!1,this.args.updateHideSchema(!1)}static#u=(()=>dt7948.n(this.prototype,"expandSchema",[o.action]))() static#d=(()=>(0,c.setComponentTemplate)((0,p.createTemplateFactory)({id:"QYfHpBC4",block:'[[[1,"\\n"],[41,[30,0,["hideSchema"]],[[[1," "],[8,[32,0],[[24,0,"no-text unhide"]],[["@action","@icon"],[[30,0,["expandSchema"]],"chevron-left"]],null],[1,"\\n"]],[]],[[[1," "],[10,0],[14,0,"schema"],[12],[1,"\\n "],[10,0],[14,0,"schema-search inline-form full-width"],[12],[1,"\\n "],[11,"input"],[24,4,"text"],[4,[32,1],["input",[28,[32,2],[[30,0,["filterChanged"]]],null]],null],[12],[13],[1,"\\n "],[8,[32,0],[[24,0,"no-text"]],[["@action","@icon"],[[30,0,["collapseSchema"]],"chevron-right"]],null],[1,"\\n "],[13],[1,"\\n\\n "],[10,0],[14,0,"schema-container"],[12],[1,"\\n "],[8,[32,3],null,[["@condition"],[[30,0,["loading"]]]],[["default"],[[[[1,"\\n "],[10,"ul"],[12],[1,"\\n"],[42,[28,[31,2],[[28,[31,2],[[30,0,["filteredTables"]]],null]],null],null,[[[1," "],[8,[32,4],null,[["@table"],[[30,1]]],null],[1,"\\n"]],[1]],null],[1," "],[13],[1,"\\n "]],[]]]]],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"]],[]]],[1," "]],["table"],false,["if","each","-track-array"]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/explorer-schema.js",scope:()=>[a.default,s.on,l.default,n.default,d.default],isStrictMode:!0}),this))()}e.default=m}),define("discourse/plugins/discourse-data-explorer/discourse/components/explorer-schema/enum-info",["exports","@glimmer/component","@ember/component","@ember/template-factory"],function(e,t,r,s){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 class o extends t.default{get enuminfo(){return Object.entries(this.args.col.enum).map(e=>{let[t,r]=e return{value:t,name:r}})}static#e=(()=>(0,r.setComponentTemplate)((0,s.createTemplateFactory)({id:"EnzLmMgQ",block:'[[[1,"\\n "],[10,"ol"],[12],[1,"\\n"],[42,[28,[31,1],[[28,[31,1],[[30,0,["enuminfo"]]],null]],null],null,[[[1," "],[10,"li"],[15,2,[30,1,["value"]]],[12],[1,"\\n "],[1,[30,1,["name"]]],[1,"\\n "],[13],[1,"\\n"]],[1]],null],[1," "],[13],[1,"\\n "]],["enum"],false,["each","-track-array"]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/explorer-schema/enum-info.js",isStrictMode:!0}),this))()}e.default=o}),define("discourse/plugins/discourse-data-explorer/discourse/components/explorer-schema/one-table",["exports","@glimmer/component","@glimmer/tracking","@ember/modifier","discourse/helpers/d-icon","discourse/lib/decorators","discourse-i18n","discourse/plugins/discourse-data-explorer/discourse/components/explorer-schema/enum-info","@ember/component","@ember/template-factory"],function(e,t,r,s,o,i,n,a,l,u){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 class d extends t.default{static#e=(()=>dt7948.g(this.prototype,"open",[r.tracked],function(){return this.args.table.open}))() #c=(()=>{dt7948.i(this,"open")})() get styles(){return this.open?"open":""}toggleOpen(){this.open=!this.open}static#t=(()=>dt7948.n(this.prototype,"toggleOpen",[i.bind]))() static#r=(()=>(0,l.setComponentTemplate)((0,u.createTemplateFactory)({id:"dy2GmGnx",block:'[[[1,"\\n "],[10,"li"],[15,0,[29,["schema-table ",[30,0,["styles"]]]]],[12],[1,"\\n"],[1," "],[11,0],[24,0,"schema-table-name"],[24,"role","button"],[4,[32,0],["click",[30,0,["toggleOpen"]]],null],[12],[1,"\\n"],[41,[30,0,["open"]],[[[1," "],[1,[28,[32,1],["caret-down"],null]],[1,"\\n"]],[]],[[[1," "],[1,[28,[32,1],["caret-right"],null]],[1,"\\n"]],[]]],[1," "],[1,[30,1,["name"]]],[1,"\\n "],[13],[1,"\\n\\n "],[10,0],[14,0,"schema-table-cols"],[12],[1,"\\n"],[41,[30,0,["open"]],[[[1," "],[10,"dl"],[12],[1,"\\n"],[42,[28,[31,2],[[28,[31,2],[[30,1,["columns"]]],null]],null],null,[[[1," "],[10,0],[12],[1,"\\n "],[10,"dt"],[15,0,[52,[30,2,["sensitive"]],"sensitive"]],[15,"title",[52,[30,2,["sensitive"]],[28,[32,2],["explorer.schema.sensitive"],null]]],[12],[1,"\\n"],[41,[30,2,["sensitive"]],[[[1," "],[1,[28,[32,1],["triangle-exclamation"],null]],[1,"\\n"]],[]],null],[1," "],[1,[30,2,["column_name"]]],[1,"\\n "],[13],[1,"\\n "],[10,"dd"],[12],[1,"\\n "],[1,[30,2,["data_type"]]],[1,"\\n"],[41,[30,2,["havetypeinfo"]],[[[1," "],[10,"br"],[12],[13],[1,"\\n"],[41,[30,2,["havepopup"]],[[[1," "],[10,0],[14,0,"popup-info"],[12],[1,"\\n "],[1,[28,[32,1],["info"],null]],[1,"\\n "],[10,0],[14,0,"popup"],[12],[1,"\\n "],[1,[30,2,["column_desc"]]],[1,"\\n"],[41,[30,2,["enum"]],[[[1," "],[8,[32,3],null,[["@col"],[[30,2]]],null],[1,"\\n"]],[]],null],[1," "],[13],[1,"\\n "],[13],[1,"\\n"]],[]],null],[1," "],[10,1],[14,0,"schema-typenotes"],[12],[1,"\\n "],[1,[30,2,["notes"]]],[1,"\\n "],[13],[1,"\\n"]],[]],null],[1," "],[13],[1,"\\n "],[13],[1,"\\n"]],[2]],null],[1," "],[13],[1,"\\n"]],[]],null],[1," "],[13],[1,"\\n "],[13],[1,"\\n "]],["@table","col"],false,["if","each","-track-array"]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/explorer-schema/one-table.js",scope:()=>[s.on,o.default,n.i18n,a.default],isStrictMode:!0}),this))()}e.default=d}),define("discourse/plugins/discourse-data-explorer/discourse/components/modal/query-help",["exports","@ember/template","discourse/components/d-modal","discourse-i18n","@ember/component","@ember/template-factory","@ember/component/template-only"],function(e,t,r,s,o,i,n){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 const a=(0,o.setComponentTemplate)((0,i.createTemplateFactory)({id:"DG9/T/vs",block:'[[[1,"\\n "],[8,[32,0],null,[["@title","@closeModal"],[[28,[32,1],["explorer.help.modal_title"],null],[30,1]]],[["body"],[[[[1,"\\n "],[1,[28,[32,2],[[28,[32,1],["explorer.help.auto_resolution"],null]],null]],[1,"\\n "],[1,[28,[32,2],[[28,[32,1],["explorer.help.custom_params"],null]],null]],[1,"\\n "],[1,[28,[32,2],[[28,[32,1],["explorer.help.default_values"],null]],null]],[1,"\\n "],[1,[28,[32,2],[[28,[32,1],["explorer.help.data_types"],null]],null]],[1,"\\n "]],[]]]]],[1,"\\n"]],["@closeModal"],false,[]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/modal/query-help.js",scope:()=>[r.default,s.i18n,t.htmlSafe],isStrictMode:!0}),(0,n.default)(void 0,"query-help:QueryHelp")) e.default=a}),define("discourse/plugins/discourse-data-explorer/discourse/components/param-input-form",["exports","@glimmer/component","@ember/object","@ember/service","@ember/string","@ember/utils","discourse/components/conditional-loading-spinner","discourse/components/form","discourse/models/category","discourse-i18n","discourse/plugins/discourse-data-explorer/discourse/components/param-input/boolean-three","discourse/plugins/discourse-data-explorer/discourse/components/param-input/category-id-input","discourse/plugins/discourse-data-explorer/discourse/components/param-input/group-input","discourse/plugins/discourse-data-explorer/discourse/components/param-input/user-id-input","discourse/plugins/discourse-data-explorer/discourse/components/param-input/user-list-input","@ember/component","@ember/template-factory","@ember/component/template-only"],function(e,t,r,s,o,i,n,a,l,u,d,c,p,m,h,f,g,y){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.ParamValidationError=e.ERRORS=void 0 class b extends Error{}e.ParamValidationError=b const _={int:"int",bigint:"string",boolean:"boolean",string:"string",time:"time",date:"date",datetime:"datetime",double:"string",user_id:"user_id",post_id:"string",topic_id:"generic",category_id:"category_id",group_id:"group_list",badge_id:"generic",int_list:"generic",string_list:"generic",user_list:"user_list",group_list:"group_list"},x=e.ERRORS={REQUIRED:(0,u.i18n)("form_kit.errors.required"),NOT_AN_INTEGER:(0,u.i18n)("form_kit.errors.not_an_integer"),NOT_A_NUMBER:(0,u.i18n)("form_kit.errors.not_a_number"),OVERFLOW_HIGH:(0,u.i18n)("form_kit.errors.too_high",{count:2147484647}),OVERFLOW_LOW:(0,u.i18n)("form_kit.errors.too_low",{count:-2147484648}),INVALID:(0,u.i18n)("explorer.form.errors.invalid"),NO_SUCH_CATEGORY:(0,u.i18n)("explorer.form.errors.no_such_category"),NO_SUCH_GROUP:(0,u.i18n)("explorer.form.errors.no_such_group"),INVALID_DATE:e=>(0,u.i18n)("explorer.form.errors.invalid_date",{date:e}),INVALID_TIME:e=>(0,u.i18n)("explorer.form.errors.invalid_time",{time:e})} function v(e,t){switch(e){case"string":case"int":return null!=t?String(t):"" case"boolean":return String(t) case"group_list":case"user_list":return t?.join(",") case"group_id":return t[0] case"datetime":return t?.replaceAll("T"," ") default:return t?.toString()}}function w(e){switch(_[e.type]){case"boolean":return e.nullable?"required":"" case"string":case"string_list":case"generic":return e.nullable?"":"required:trim" default:return e.nullable?"":"required"}}const k={int:(0,f.setComponentTemplate)((0,g.createTemplateFactory)({id:"Ui8byv2k",block:'[[[1,"\\n "],[8,[30,1,["Input"]],[[16,3,[30,2,["identifier"]]]],[["@type"],["number"]],null],[1,"\\n "]],["@field","@info"],false,[]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/param-input-form.js",isStrictMode:!0}),(0,y.default)(void 0,void 0)),boolean:(0,f.setComponentTemplate)((0,g.createTemplateFactory)({id:"EZWX6cT0",block:'[[[8,[30,1,["Checkbox"]],[[16,3,[30,2,["identifier"]]]],null,null]],["@field","@info"],false,[]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/param-input-form.js",isStrictMode:!0}),(0,y.default)(void 0,void 0)),boolean_three:d.default,category_id:c.default,user_id:m.default,user_list:h.default,group_list:p.default,date:(0,f.setComponentTemplate)((0,g.createTemplateFactory)({id:"OzZxZsFL",block:'[[[1,"\\n "],[8,[30,1,["Input"]],[[16,3,[30,2,["identifier"]]]],[["@type"],["date"]],null],[1,"\\n "]],["@field","@info"],false,[]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/param-input-form.js",isStrictMode:!0}),(0,y.default)(void 0,void 0)),time:(0,f.setComponentTemplate)((0,g.createTemplateFactory)({id:"fJpbDe7u",block:'[[[1,"\\n "],[8,[30,1,["Input"]],[[16,3,[30,2,["identifier"]]]],[["@type"],["time"]],null],[1,"\\n "]],["@field","@info"],false,[]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/param-input-form.js",isStrictMode:!0}),(0,y.default)(void 0,void 0)),datetime:(0,f.setComponentTemplate)((0,g.createTemplateFactory)({id:"LSXrF4Ey",block:'[[[1,"\\n "],[8,[30,1,["Input"]],[[16,3,[30,2,["identifier"]]]],[["@type"],["datetime-local"]],null],[1,"\\n "]],["@field","@info"],false,[]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/param-input-form.js",isStrictMode:!0}),(0,y.default)(void 0,void 0)),default:(0,f.setComponentTemplate)((0,g.createTemplateFactory)({id:"RWJET0M1",block:'[[[8,[30,1,["Input"]],[[16,3,[30,2,["identifier"]]]],null,null]],["@field","@info"],false,[]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/param-input-form.js",isStrictMode:!0}),(0,y.default)(void 0,void 0))} function j(e){let t=_[e.type]||"generic" return e.nullable&&"boolean"===t&&(t="boolean_three"),k[t]||k.default}class T extends t.default{static#e=(()=>dt7948.g(this.prototype,"site",[s.service]))() #p=(()=>{dt7948.i(this,"site")})() data={} paramInfo=[] infoOf={} form=null promiseNormalizations=[] formLoaded=(()=>new Promise(e=>{this.__form_load_callback=e}))() constructor(){super(...arguments),this.initializeParams(),this.args.onRegisterApi?.({submit:this.submit,allNormalized:Promise.allSettled(this.promiseNormalizations)})}initializeParams(){this.args.paramInfo.forEach(e=>{const t=e.identifier,r=this.createParamInfo(e) this.paramInfo.push(r),this.infoOf[t]=e const s=this.getNormalizedValue(e) s instanceof Promise?this.handlePromiseNormalization(s,r):this.data[t]=s})}createParamInfo(e){return r.default.create({...e,validation:w(e),validate:this.validatorOf(e),component:j(e)})}async addError(e,t){await this.formLoaded,this.form.addError(e,{title:e,message:t})}static#t=(()=>dt7948.n(this.prototype,"addError",[r.action]))() normalizeValue(e,t){switch(e.type){case"category_id":return function(e){return e=String(e||""),!/^\d+$/.test(e)&&e.trim()?l.default.asyncFindBySlugPath((0,o.dasherize)(e)).then(e=>e.id).catch(t=>{throw 404===t.jqXHR?.status?new b(`${x.NO_SUCH_CATEGORY}: ${e}`):new Error(t.errorThrow||t.message)}):e}(t) case"boolean":return null==t||"#null"===t?!!e.nullable&&"#null":"true"===t case"group_id":case"group_list":const r=this.normalizeGroups(t) return r.errorMsg&&this.addError(e.identifier,r.errorMsg),"group_id"===e.type?r.value.slice(0,1):r.value case"user_list":return Array.isArray(t)?t||null:t?.split(",")||null case"user_id":return Array.isArray(t)?t[0]:t case"date":try{return t?moment(t).format("YYYY-MM-DD"):null}catch{return this.addError(e.identifier,x.INVALID_DATE(String(t))),null}case"time":try{return t?moment(new Date(`1970/01/01 ${t}`).toISOString()).format("HH:mm"):null}catch{return this.addError(e.identifier,x.INVALID_TIME(String(t))),null}case"datetime":try{return t?moment(new Date(t).toISOString()).format("YYYY-MM-DD HH:mm"):null}catch{return this.addError(e.identifier,x.INVALID_TIME(String(t))),null}default:return t}}static#r=(()=>dt7948.n(this.prototype,"normalizeValue",[r.action]))() getNormalizedValue(e){const t=this.args.initialValues,r=e.identifier return this.normalizeValue(e,t&&r in t?t[r]:e.default)}handlePromiseNormalization(e,t){this.promiseNormalizations.push(e),t.set("loading",!0),this.data[t.identifier]=null,e.then(e=>this.form.set(t.identifier,e)).catch(e=>this.addError(t.identifier,e.message)).finally(()=>t.set("loading",!1))}normalizeGroups(e){e||=[],"string"==typeof e&&(e=e.split(",")) const t=new Set(this.site.get("groups").map(e=>e.name)),r=Object.fromEntries(this.site.get("groups").map(e=>[e.id,e.name])),s=[],o=[] for(const i of e)t.has(i)?s.push(i):r[Number(i)]?s.push(r[Number(i)]):o.push(String(i)) return{value:s,errorMsg:0!==o.length?`${x.NO_SUCH_GROUP}: ${o.join(", ")}`:null}}static#n=(()=>dt7948.n(this.prototype,"normalizeGroups",[r.action]))() getErrorFn(e){const t=e=>/^\d+$/.test(e) return{int:e=>e>=2147483648?x.OVERFLOW_HIGH:e<=-2147483649?x.OVERFLOW_LOW:null,bigint:e=>isNaN(parseInt(e,10))?x.NOT_A_NUMBER:/^-?\d+$/.test(e)?null:x.NOT_AN_INTEGER,boolean:e=>/^Y|N|#null|true|false/.test(String(e))?null:x.INVALID,double:e=>isNaN(parseFloat(e))?/^(-?)Inf(inity)?$/i.test(e)||/^(-?)NaN$/i.test(e)?null:x.NOT_A_NUMBER:null,int_list:e=>e.split(",").every(e=>/^(-?\d+|null)$/.test(e.trim()))?null:x.INVALID,post_id:e=>t(e)||/\d+\/\d+(\?u=.*)?$/.test(e)||/\/t\/[^/]+\/(\d+)(\?u=.*)?/.test(e)?null:x.INVALID,topic_id:e=>t(e)||/\/t\/[^/]+\/(\d+)/.test(e)?null:x.INVALID,category_id:e=>this.site.categoriesById.get(Number(e))?null:x.NO_SUCH_CATEGORY,group_list:e=>this.normalizeGroups(e).errorMsg,group_id:e=>this.normalizeGroups(e).errorMsg}[e.type]??(()=>null)}validatorOf(e){const t=this.getErrorFn(e) return(r,s,o)=>{let{addError:n}=o if((0,i.isEmpty)(s)||null==s)return const a=t(s) null!=a&&n(r,{title:e.identifier,message:a})}}async submit(){if(null==this.form)throw"No form" if(this.serializedData=null,await this.form.submit(),null==this.serializedData)throw new b("validation_failed") return this.serializedData}static#a=(()=>dt7948.n(this.prototype,"submit",[r.action]))() onRegisterApi(e){this.__form_load_callback(),this.form=e}static#l=(()=>dt7948.n(this.prototype,"onRegisterApi",[r.action]))() onSubmit(e){const t={} for(const[r,s]of Object.entries(e))t[r]=v(this.infoOf[r].type,s)??void 0 this.serializedData=t}static#u=(()=>dt7948.n(this.prototype,"onSubmit",[r.action]))() static#d=(()=>(0,f.setComponentTemplate)((0,g.createTemplateFactory)({id:"K6kFJTOW",block:'[[[1,"\\n "],[10,0],[14,0,"query-params"],[12],[1,"\\n "],[8,[32,0],[[24,0,"params-form"]],[["@data","@onRegisterApi","@onSubmit"],[[30,0,["data"]],[30,0,["onRegisterApi"]],[30,0,["onSubmit"]]]],[["default"],[[[[1,"\\n"],[42,[28,[31,1],[[28,[31,1],[[30,0,["paramInfo"]]],null]],null],null,[[[1," "],[10,0],[14,0,"param"],[12],[1,"\\n "],[8,[30,1,["Field"]],null,[["@name","@title","@validation","@validate"],[[30,2,["identifier"]],[30,2,["identifier"]],[30,2,["validation"]],[30,2,["validate"]]]],[["default"],[[[[1,"\\n "],[8,[30,2,["component"]],null,[["@field","@info"],[[30,3],[30,2]]],null],[1,"\\n "],[8,[32,1],null,[["@condition","@size"],[[30,2,["loading"]],"small"]],null],[1,"\\n "]],[3]]]]],[1,"\\n "],[13],[1,"\\n"]],[2]],null],[1," "]],[1]]]]],[1,"\\n "],[13],[1,"\\n "]],["form","info","field"],false,["each","-track-array"]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/param-input-form.js",scope:()=>[a.default,n.default],isStrictMode:!0}),this))()}e.default=T}),define("discourse/plugins/discourse-data-explorer/discourse/components/param-input/boolean-three",["exports","discourse-i18n","@ember/component","@ember/template-factory","@ember/component/template-only"],function(e,t,r,s,o){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 const i=(0,r.setComponentTemplate)((0,s.createTemplateFactory)({id:"cc7ywRhg",block:'[[[1,"\\n "],[8,[30,1,["Select"]],[[16,3,[30,2,["identifier"]]]],null,[["default"],[[[[1,"\\n "],[8,[30,3,["Option"]],null,[["@value"],["Y"]],[["default"],[[[[1,"\\n "],[1,[28,[32,0],["explorer.types.bool.true"],null]],[1,"\\n "]],[]]]]],[1,"\\n "],[8,[30,3,["Option"]],null,[["@value"],["N"]],[["default"],[[[[1,"\\n "],[1,[28,[32,0],["explorer.types.bool.false"],null]],[1,"\\n "]],[]]]]],[1,"\\n "],[8,[30,3,["Option"]],null,[["@value"],["#null"]],[["default"],[[[[1,"\\n "],[1,[28,[32,0],["explorer.types.bool.null_"],null]],[1,"\\n "]],[]]]]],[1,"\\n "]],[3]]]]],[1,"\\n"]],["@field","@info","select"],false,[]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/param-input/boolean-three.js",scope:()=>[t.i18n],isStrictMode:!0}),(0,o.default)(void 0,"boolean-three:BooleanThree")) e.default=i}),define("discourse/plugins/discourse-data-explorer/discourse/components/param-input/category-id-input",["exports","@glimmer/component","@ember/helper","select-kit/components/category-chooser","@ember/component","@ember/template-factory"],function(e,t,r,s,o,i){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 class n extends t.default{get data(){return{value:this.args.field.value}}static#e=(()=>(0,o.setComponentTemplate)((0,i.createTemplateFactory)({id:"wmz1RnhC",block:'[[[1,"\\n "],[8,[30,1,["Custom"]],[[16,1,[30,1,["id"]]]],null,[["default"],[[[[1,"\\n "],[8,[32,0],[[16,3,[30,2,["identifier"]]]],[["@value","@onChange","@options"],[[30,0,["data","value"]],[30,1,["set"]],[28,[32,1],null,[["allowUncategorized","autoInsertNoneItem","none"],[null,true,true]]]]],null],[1,"\\n "]],[]]]]],[1,"\\n "]],["@field","@info"],false,[]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/param-input/category-id-input.js",scope:()=>[s.default,r.hash],isStrictMode:!0}),this))()}e.default=n}),define("discourse/plugins/discourse-data-explorer/discourse/components/param-input/group-input",["exports","@glimmer/component","@ember/service","select-kit/components/group-chooser","@ember/component","@ember/template-factory"],function(e,t,r,s,o,i){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 class n extends t.default{static#e=(()=>dt7948.g(this.prototype,"site",[r.service]))() #p=(()=>{dt7948.i(this,"site")})() get allGroups(){return this.site.get("groups")}get groupChooserOption(){return"group_id"===this.args.info.type?{maximum:1}:{}}static#t=(()=>(0,o.setComponentTemplate)((0,i.createTemplateFactory)({id:"+pze88n5",block:'[[[1,"\\n "],[8,[30,1,["Custom"]],[[16,1,[30,1,["id"]]]],null,[["default"],[[[[1,"\\n "],[8,[32,0],[[16,3,[30,2,["identifier"]]]],[["@content","@value","@labelProperty","@valueProperty","@onChange","@options"],[[30,0,["allGroups"]],[30,1,["value"]],"name","name",[30,1,["set"]],[30,0,["groupChooserOption"]]]],null],[1,"\\n "]],[]]]]],[1,"\\n "]],["@field","@info"],false,[]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/param-input/group-input.js",scope:()=>[s.default],isStrictMode:!0}),this))()}e.default=n}),define("discourse/plugins/discourse-data-explorer/discourse/components/param-input/user-id-input",["exports","@ember/helper","select-kit/components/email-group-user-chooser","@ember/component","@ember/template-factory","@ember/component/template-only"],function(e,t,r,s,o,i){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 const n=(0,s.setComponentTemplate)((0,o.createTemplateFactory)({id:"CNPvwRat",block:'[[[1,"\\n "],[8,[30,1,["Custom"]],[[16,1,[30,1,["id"]]]],null,[["default"],[[[[1,"\\n "],[8,[32,0],[[16,3,[30,2,["identifier"]]]],[["@value","@options","@onChange"],[[30,1,["value"]],[28,[32,1],null,[["maximum"],[1]]],[30,1,["set"]]]],null],[1,"\\n "]],[]]]]],[1,"\\n"]],["@field","@info"],false,[]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/param-input/user-id-input.js",scope:()=>[r.default,t.hash],isStrictMode:!0}),(0,i.default)(void 0,"user-id-input:UserIdInput")) e.default=n}),define("discourse/plugins/discourse-data-explorer/discourse/components/param-input/user-list-input",["exports","select-kit/components/email-group-user-chooser","@ember/component","@ember/template-factory","@ember/component/template-only"],function(e,t,r,s,o){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 const i=(0,r.setComponentTemplate)((0,s.createTemplateFactory)({id:"y3XBxOri",block:'[[[1,"\\n "],[8,[30,1,["Custom"]],[[16,1,[30,1,["id"]]]],null,[["default"],[[[[1,"\\n "],[8,[32,0],[[16,3,[30,2,["identifier"]]]],[["@value","@onChange"],[[30,1,["value"]],[30,1,["set"]]]],null],[1,"\\n "]],[]]]]],[1,"\\n"]],["@field","@info"],false,[]]',moduleName:"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-data-explorer/discourse/components/param-input/user-list-input.js",scope:()=>[t.default],isStrictMode:!0}),(0,o.default)(void 0,"user-list-input:UserListInput")) e.default=i}),define("discourse/plugins/discourse-data-explorer/discourse/components/query-result",["exports","@glimmer/component","@glimmer/tracking","@ember/object","@ember/runloop","@ember/service","@ember/string","discourse/components/d-button","discourse/lib/ajax","discourse/lib/get-url","discourse/models/badge","discourse/models/category","discourse-i18n","discourse/plugins/discourse-data-explorer/discourse/components/data-explorer-bar-chart","discourse/plugins/discourse-data-explorer/discourse/components/query-row-content","discourse/plugins/discourse-data-explorer/discourse/components/result-types/badge","discourse/plugins/discourse-data-explorer/discourse/components/result-types/category","discourse/plugins/discourse-data-explorer/discourse/components/result-types/group","discourse/plugins/discourse-data-explorer/discourse/components/result-types/html","discourse/plugins/discourse-data-explorer/discourse/components/result-types/json","discourse/plugins/discourse-data-explorer/discourse/components/result-types/post","discourse/plugins/discourse-data-explorer/discourse/components/result-types/reltime","discourse/plugins/discourse-data-explorer/discourse/components/result-types/tag-group","discourse/plugins/discourse-data-explorer/discourse/components/result-types/text","discourse/plugins/discourse-data-explorer/discourse/components/result-types/topic","discourse/plugins/discourse-data-explorer/discourse/components/result-types/url","discourse/plugins/discourse-data-explorer/discourse/components/result-types/user","@ember/component","@ember/template-factory"],function(e,t,r,s,o,i,n,a,l,u,d,c,p,m,h,f,g,y,b,_,x,v,w,k,j,T,C,S,N){"use strict" Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0 const P={topic:j.default,text:k.default,post:x.default,reltime:v.default,badge:f.default,url:T.default,user:C.default,group:y.default,html:b.default,json:_.default,category:g.default,tag_group:w.default} class q extends t.default{static#e=(()=>dt7948.g(this.prototype,"site",[i.service]))() #p=(()=>{dt7948.i(this,"site")})() static#t=(()=>dt7948.g(this.prototype,"chartDisplayed",[r.tracked],function(){return!1}))() #m=(()=>{dt7948.i(this,"chartDisplayed")})() get colRender(){return this.args.content.colrender||{}}get rows(){return this.args.content.rows}get columns(){return this.args.content.columns}get params(){return this.args.content.params}get explainText(){return this.args.content.explain}get chartDatasetName(){return this.columnNames[1]}get columnNames(){return this.columns?this.columns.map(e=>{if(e.endsWith("_id"))return e.slice(0,-3) const t=e.indexOf("$") return t>=0?e.substring(t+1):e}):[]}get columnComponents(){return this.columns?this.columns.map((e,t)=>{let r="text" return this.colRender[t]&&(r=this.colRender[t]),{name:r,component:P[r]}}):[]}get chartValues(){return this.rows.mapBy(1)}get colCount(){return this.columns.length}get resultCount(){const e=this.args.content.result_count return e===this.args.content.default_limit?(0,p.i18n)("explorer.max_result_count",{count:e}):(0,p.i18n)("explorer.result_count",{count:e})}get duration(){return(0,p.i18n)("explorer.run_time",{value:p.default.toNumber(this.args.content.duration,{precision:1})})}get parameterAry(){let e=[] for(let t in this.params)this.params.hasOwnProperty(t)&&e.push({key:t,value:this.params[t]}) return e}get transformedUserTable(){return O(this.args.content.relations.user)}get transformedBadgeTable(){return O(this.args.content.relations.badge,d.default)}get transformedPostTable(){return O(this.args.content.relations.post)}get transformedTopicTable(){return O(this.args.content.relations.topic)}get transformedTagGroupTable(){return O(this.args.content.relations.tag_group)}get transformedGroupTable(){return O(this.site.groups)}get canShowChart(){const e=2===this.colCount,t=this.resultCount[0]>0&&"number"==typeof this.rows[0][1],r=this.colRender[1] return e&&t&&!r}get chartLabels(){const e={user:e=>e.username,badge:e=>e.name,topic:e=>e.title,group:e=>e.name,category:e=>e.name},t=this.colRender[0] if(t){const r=this[`lookup${(0,n.capitalize)(t)}`],s=e[t] if(r&&s)return this.rows.map(e=>{const t=r.call(this,e[0]),o=s(t) return this._cutChartLabel(o)})}return this.rows.map(e=>this._cutChartLabel(e[0]))}lookupUser(e){return this.transformedUserTable[e]}lookupBadge(e){return this.transformedBadgeTable[e]}lookupPost(e){return this.transformedPostTable[e]}lookupTopic(e){return this.transformedTopicTable[e]}lookupTagGroup(e){return this.transformedTagGroupTable[e]}lookupGroup(e){return this.transformedGroupTable[e]}lookupCategory(e){return c.default.findById(e)}_cutChartLabel(e){const t=e.toString() return t.length>25?`${t.substring(0,25)}...`:t}downloadResultJson(){this._downloadResult("json")}static#r=(()=>dt7948.n(this.prototype,"downloadResultJson",[s.action]))() downloadResultCsv(){this._downloadResult("csv")}static#n=(()=>dt7948.n(this.prototype,"downloadResultCsv",[s.action]))() showChart(){this.chartDisplayed=!0}static#a=(()=>dt7948.n(this.prototype,"showChart",[s.action]))() hideChart(){this.chartDisplayed=!1}static#l=(()=>dt7948.n(this.prototype,"hideChart",[s.action]))() _download_url(){return this.args.group?`/g/${this.args.group.name}/reports/`:"/admin/plugins/explorer/queries/"}_downloadResult(e){let t="xxxxxxxx".replace(/[xy]/g,()=>(16*Math.random()|0).toString(16)) window.open("data:text/html;base64,"+btoa("Click anywhere to close this window once the download finishes.